package com.yami.shop.nftaccount.common.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yami.shop.nftaccount.common.model.NftAssetSettle;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface NftAssetSettleMapper extends BaseMapper<NftAssetSettle> {


    @Select("SELECT a.* FROM tz_nft_asset_settle a WHERE a.`status` = 0 " +
            "and TO_DAYS(a.settle_time) <= TO_DAYS(now()) " +
            "and NOT EXISTS (SELECT 1 FROM tz_nft_asset_settle b WHERE b.token_id = a.token_id and b.`status` in (3,4)) " +
            "ORDER BY a.id limit #{size} ")
    List<NftAssetSettle> getSettleListExcludeException(@Param("size") int size);
    
    
    
}
